package com.mp.approvalreq.entity;

import com.mp.approvalreq.entity.adjust.VersionInfo;
import com.plusmoney.util.Utils;

import java.sql.Timestamp;
import java.util.*;


public class Request extends Condition {

    private List<TemplateComponent> componentsContent;
    private String componentsContentsStr;
    private List<People> peopleList;
    private List<People> relaPeopleList;
    private String relaPeopleListStr;
    private List<Cc> ccList;

    /**
     * 审批流主键
     */
    private int requestDkey;
    private String contentIds;
    private String contentNums;

    private String requestName;
    /**
     * 申请人
     */
    private int applicant;
    /**
     * 申请人名字
     */
    private String applicantName;
    /**
     * 申请时间
     */
    private String requestTime;
    /**
     * 创建时间
     */
    private Date createTimestamp;
    /**
     * 审批步骤，0表示新的，-1表示已撤回，1表示进行到第一个人，以此类推
     */
    private Integer requestStep;
    /**
     * 每一次的审批时间，以xxxx-xx-xx xx:xx:xx,xxxx-xx-xx xx:xx:xx这种形式保存
     */
    private String checkedTime;
    /**
     * 所有审批人xx,xx,xx,xx
     */
    private String allJudger;
    /**
     * 所有审批人xx,xx,xx,xx
     */
    private String allJudgerToEdit;
    /**
     * 已经审批人xx,xx,xx,xx
     */
    private String whoConfirm;
    /**
     * 拒绝人
     */
    private String whoRefused;
    /**
     * 下一个人
     */
    private String whoTheNext;
    /**
     * 已归档的抄送人：格式xx,x,xxx,xxxx
     */
    private String archived;

    /**
     * 抄送人
     */
    private String cc;
    /**
     * 临时抄送人
     */
    private String ccTemp;
    /**
     * 审批操作，1表示同意，2拒绝
     */
    private Integer requestOperation;
    /**
     * 0表示进行中，1表示已同意，2表示已全部归档，3表示已拒绝
     */
    private int finished;
    /**
     * 0表示进行中，1表示已同意，2表示已全部归档，3表示已拒绝
     */
    private String finishedSequence;

    /**
     * 外出经纬度，格式xx.xxxxxx,xxx.xxxxxx
     */
    private String outerPosition;

    private String startTime;

    private String endTime;

    private String callBackTime;

    private String disableTime;

    private Integer operatorId;

    /**
     * 基于哪个来改
     */
    private Integer parentRequestId;
    /**
     * 拒绝链
     */
    private String refuseChain;
    /**
     * 拒绝链
     */
    private List<RefuseChain> refuseChainObj;
    /**
     * 评论个数
     */
    private int commentCount;
    /**
     * 参与人
     */
    private String relaPeople;
    /**
     * 是否修改过后重新提交
     */
    private Integer isResubmit;
    /**
     * 手动终止时间
     */
    private Timestamp manualEndingTime;
    /**
     * 手动终止时间
     */
    private String manualEndingTimeStr;
    /**
     * 用于记录比如请假等审批的时间跨度：(审批上或申请人申请的请假时长,如请假今天上午11点到下午2点,则这里记录时长为：3个小时)
     */
    private String requestContentLastStr;
    /**
     * 用于记录比如请假等审批的时间跨度： 存放计算好了的时长(实际上的请假时长,如果请假期间撤回则该值小于请假时长),单位为秒
     */
    private String requestContentLastTotalSecond;
    /**
     * 拒绝红点
     */
    private Integer refuseRedPoint;
    /**
     * 我的审批时间（排序用）
     */
    private String finallyConfirmedTime;
    /**
     * 我的归档时间（排序用）
     */
    private String finallyCcTime;
    /**
     * 审批的祖先id
     */
    private Integer requestAncestorId;
    /**
     * 存放前端显示的自然时间 ：如报销模板的 支出时间,未打开证明模板的未打卡时间,请假模板的 请假开始时间等等
     */
    private String naturalContentTimeLast;
    /**
     * 是否是年假(1是年假)
     */
    private Integer isAnnualLeave;
    /**
     * 是否已销假，-1为请假前的销假，1为请假中的销假
     */
    private Integer isLeavePause;

    private int applicantCiid;        //申请人主id
    private String whoTheNextCiid;        //下一个审批人主id
    private String allJudgerCiid;    //所有审批人主id
    private String whoRefusedCiid;    //驳回人主id
    private String ccCiid;            //抄送人群主id
    private String whoConfirmCiid;    //已经审批人主id
    private String relaPeopleCiid;    //参与人群主id

    private String approvalNum; // 审批编号,自动生成的,数据库并没有该字段

    private Integer atRedPoint;      // 艾特红点

    private String totalMoney;  // 报销总额: 新版本报销提交时,肯定不为null,老版本提交时则为null

    private Integer generation;  // 模板版本更新记录,6-11号定义,此时的模板版本都为1,目前只改了报销模板

    private String contactIdSubmitTime; // contactId-时间戳(毫秒数), 用于判断单个页面重复的提交数

    @Deprecated
    private Integer ccUnRead;       //  抄送人未读抄送审批的红点:1未读,0已读

    private Integer redPoint; // 未读红点

    // 请假模板显示的: 请假时长(做年假时接入)
    private String leaveDuration;

    private Leave leave;

    private Outdoor outdoor;

    private List<AppendSign> appendSigns;

    private List<Overtime> overtimes;

    private List<Expense> expenses;

    private List<Flow> flows;

    private List<Participant> participants;

    private List<Money> moneys;

    private String searchContent;

    private String searchMessage;

    private Integer companyInfoId;

    private List<Integer> operations;

    private Integer withoutContact;

    private String latestApprovedTime;

    private String showTime;

    /**
     * 审批摘要（卡片内容）
     */
    private Summary summary;

    private Integer operate;
    /**
     * 代申请人id
     */
    private Integer proxyContactId;
    /**
     * 财务审批状态  0.默认;1.待付款;2.已付款
     */
    private int financialStatus;
    /**
     * 财务审批状态 0.默认;1.待付款;2.已付款 （用于搜索,可以传多个  默认0,1,2）
     */
    private String financialStatusSequence;

    private VersionInfo versionInfo;

    private List<Integer> requestIds;

    /**
     * 最新的审批
     */
    private Request newestRequest;

    public String getLeaveDuration() {
        return leaveDuration;
    }

    public void setLeaveDuration(String leaveDuration) {
        this.leaveDuration = leaveDuration;
    }

    public Integer getCcUnRead() {
        return ccUnRead;
    }

    public void setCcUnRead(Integer ccUnRead) {
        this.ccUnRead = ccUnRead;
    }

    public Integer getRedPoint() {
        return redPoint;
    }

    public void setRedPoint(Integer redPoint) {
        this.redPoint = redPoint;
    }

    public String getContactIdSubmitTime() {
        return contactIdSubmitTime;
    }

    public void setContactIdSubmitTime(String contactIdSubmitTime) {
        this.contactIdSubmitTime = contactIdSubmitTime;
    }

    public Integer getGeneration() {
        return generation;
    }

    public void setGeneration(Integer generation) {
        this.generation = generation;
    }

    public String getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(String totalMoney) {
        this.totalMoney = totalMoney;
    }

    public String getApprovalNum() {
        return approvalNum;
    }

    public void setApprovalNum(String approvalNum) {
        this.approvalNum = approvalNum;
    }

    public int getApplicantCiid() {
        return applicantCiid;
    }

    public void setApplicantCiid(int applicantCiid) {
        this.applicantCiid = applicantCiid;
    }

    public String getAllJudgerCiid() {
        return allJudgerCiid;
    }

    public void setAllJudgerCiid(String allJudgerCiid) {
        this.allJudgerCiid = allJudgerCiid;
    }

    public String getWhoRefusedCiid() {
        return whoRefusedCiid;
    }

    public void setWhoRefusedCiid(String whoRefusedCiid) {
        this.whoRefusedCiid = whoRefusedCiid;
    }

    public String getCcCiid() {
        return ccCiid;
    }

    public void setCcCiid(String ccCiid) {
        this.ccCiid = ccCiid;
    }

    public String getWhoConfirmCiid() {
        return whoConfirmCiid;
    }

    public void setWhoConfirmCiid(String whoConfirmCiid) {
        this.whoConfirmCiid = whoConfirmCiid;
    }

    public String getRelaPeopleCiid() {
        return relaPeopleCiid;
    }

    public void setRelaPeopleCiid(String relaPeopleCiid) {
        this.relaPeopleCiid = relaPeopleCiid;
    }

    public String getRelaPeopleListStr() {
        return relaPeopleListStr;
    }

    public void setRelaPeopleListStr(String relaPeopleListStr) {
        this.relaPeopleListStr = relaPeopleListStr;
    }


    public Integer getIsLeavePause() {
        return isLeavePause;
    }

    public void setIsLeavePause(Integer isLeavePause) {
        this.isLeavePause = isLeavePause;
    }

    public String getNaturalContentTimeLast() {
        return naturalContentTimeLast;
    }

    public void setNaturalContentTimeLast(String naturalContentTimeLast) {
        this.naturalContentTimeLast = naturalContentTimeLast;
    }

    public String getRequestContentLastTotalSecond() {
        return requestContentLastTotalSecond;
    }

    public void setRequestContentLastTotalSecond(
            String requestContentLastTotalSecond) {
        this.requestContentLastTotalSecond = requestContentLastTotalSecond;
    }

    public Integer getRequestAncestorId() {
        return requestAncestorId;
    }

    public void setRequestAncestorId(Integer requestAncestorId) {
        this.requestAncestorId = requestAncestorId;
    }

    public String getFinallyConfirmedTime() {
        return finallyConfirmedTime;
    }

    public void setFinallyConfirmedTime(String finallyConfirmedTime) {
        this.finallyConfirmedTime = finallyConfirmedTime;
    }

    public String getFinallyCcTime() {
        return finallyCcTime;
    }

    public void setFinallyCcTime(String finallyCcTime) {
        this.finallyCcTime = finallyCcTime;
    }

    public String getAllJudgerToEdit() {
        return allJudgerToEdit;
    }

    public void setAllJudgerToEdit(String allJudgerToEdit) {
        this.allJudgerToEdit = allJudgerToEdit;
    }

    public Integer getRefuseRedPoint() {
        return refuseRedPoint;
    }

    public void setRefuseRedPoint(Integer refuseRedPoint) {
        this.refuseRedPoint = refuseRedPoint;
    }

    public String getManualEndingTimeStr() {
        return manualEndingTimeStr;
    }

    public void setManualEndingTimeStr(String manualEndingTimeStr) {
        this.manualEndingTimeStr = manualEndingTimeStr;
    }


    public String getDisableTime() {
        return disableTime;
    }

    public void setDisableTime(String disableTime) {
        this.disableTime = disableTime;
    }

    public Integer getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Integer operatorId) {
        this.operatorId = operatorId;
    }

    public String getCallBackTime() {
        return callBackTime;
    }

    public void setCallBackTime(String callBackTime) {
        this.callBackTime = callBackTime;
    }

    public Timestamp getManualEndingTime() {
        return manualEndingTime;
    }

    public void setManualEndingTime(Timestamp manualEndingTime) {
        this.manualEndingTime = manualEndingTime;
    }

    public String getCcTemp() {
        return ccTemp;
    }

    public void setCcTemp(String ccTemp) {
        this.ccTemp = ccTemp;
    }

    public Integer getIsResubmit() {
        return isResubmit;
    }

    public void setIsResubmit(Integer isResubmit) {
        this.isResubmit = isResubmit;
    }

    public List<People> getRelaPeopleList() {
        return relaPeopleList;
    }

    public void setRelaPeopleList(List<People> relaPeopleList) {
        this.relaPeopleList = relaPeopleList;
    }


    public String getRelaPeople() {
        return relaPeople;
    }


    public void setRelaPeople(String relaPeople) {
        this.relaPeople = relaPeople;
    }


    public String getRequestContentLastStr() {
        return requestContentLastStr;
    }

    public void setRequestContentLastStr(String requestContentLastStr) {
        this.requestContentLastStr = requestContentLastStr;
    }


    public List<RefuseChain> getRefuseChainObj() {
        return refuseChainObj;
    }

    public void setRefuseChainObj(List<RefuseChain> refuseChainObj) {
        this.refuseChainObj = refuseChainObj;
    }

    public String getRefuseChain() {
        return refuseChain;
    }

    public void setRefuseChain(String refuseChain) {
        this.refuseChain = refuseChain;
    }


    public Integer getParentRequestId() {
        return parentRequestId;
    }


    public void setParentRequestId(Integer parentRequestId) {
        this.parentRequestId = parentRequestId;
    }


    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public List<Cc> getCcList() {
        return ccList;
    }

    public void setCcList(List<Cc> ccList) {
        this.ccList = ccList;
    }


    public String getOuterPosition() {
        return outerPosition;
    }

    public void setOuterPosition(String outerPosition) {
        this.outerPosition = outerPosition;
    }

    public String getFinishedSequence() {
        return finishedSequence;
    }

    public void setFinishedSequence(String finishedSequence) {
        this.finishedSequence = finishedSequence;
    }

    public int getFinished() {
        return finished;
    }

    public void setFinished(int finished) {
        this.finished = finished;
    }

    public Integer getRequestOperation() {
        return requestOperation;
    }

    public void setRequestOperation(Integer requestOperation) {
        this.requestOperation = requestOperation;
    }

    public String getApplicantName() {
        return applicantName;
    }

    public void setApplicantName(String applicantName) {
        this.applicantName = applicantName;
    }

    public List<People> getPeopleList() {
        return peopleList;
    }

    public void setPeopleList(List<People> peopleList) {
        this.peopleList = peopleList;
    }

    public Integer getRequestStep() {
        return requestStep;
    }

    public void setRequestStep(Integer requestStep) {
        this.requestStep = requestStep;
    }

    public void addRequestStep() {
        if (Utils.isNull(requestStep)) {
            requestStep = 0;
        }
        this.requestStep++;
    }

    public String getCheckedTime() {
        return checkedTime;
    }

    public void setCheckedTime(String checkedTime) {
        this.checkedTime = checkedTime;
    }

    public String getAllJudger() {
        return allJudger;
    }

    public void setAllJudger(String allJudger) {
        this.allJudger = allJudger;
    }

    public String getWhoConfirm() {
        return whoConfirm;
    }

    public void setWhoConfirm(String whoConfirm) {
        this.whoConfirm = whoConfirm;
    }

    public String getWhoRefused() {
        return whoRefused;
    }

    public void setWhoRefused(String whoRefused) {
        this.whoRefused = whoRefused;
    }

    public String getArchived() {
        return archived;
    }

    public void setArchived(String archived) {
        this.archived = archived;
    }

    @Override
    public String getCc() {
        return cc;
    }

    @Override
    public void setCc(String cc) {
        this.cc = cc;
    }

    public String getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(String requestTime) {
        this.requestTime = requestTime;
    }

    public Date getCreateTimestamp() {
        return createTimestamp;
    }

    public void setCreateTimestamp(Date createTimestamp) {
        this.createTimestamp = createTimestamp;
    }

    public String getWhoTheNext() {
        return whoTheNext;
    }

    public void setWhoTheNext(String whoTheNext) {
        this.whoTheNext = whoTheNext;
    }

    public String getWhoTheNextCiid() {
        return whoTheNextCiid;
    }

    public void setWhoTheNextCiid(String whoTheNextCiid) {
        this.whoTheNextCiid = whoTheNextCiid;
    }

    public int getApplicant() {
        return applicant;
    }

    public void setApplicant(int applicant) {
        this.applicant = applicant;
    }

    public String getRequestName() {
        return requestName;
    }

    public void setRequestName(String requestName) {
        this.requestName = requestName;
    }

    public String getContentIds() {
        return contentIds;
    }

    public void setContentIds(String contentIds) {
        this.contentIds = contentIds;
    }

    public String getContentNums() {
        return contentNums;
    }

    public void setContentNums(String contentNums) {
        this.contentNums = contentNums;
    }

    public int getRequestDkey() {
        return requestDkey;
    }

    public void setRequestDkey(int requestDkey) {
        this.requestDkey = requestDkey;
    }

    public List<TemplateComponent> getComponentsContent() {
        return componentsContent;
    }

    public void setComponentsContent(List<TemplateComponent> componentsContent) {
        this.componentsContent = componentsContent;
    }

    public String getComponentsContentsStr() {
        return componentsContentsStr;
    }

    public void setComponentsContentsStr(String componentsContentsStr) {
        this.componentsContentsStr = componentsContentsStr;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public Integer getIsAnnualLeave() {
        return isAnnualLeave;
    }

    public void setIsAnnualLeave(Integer isAnnualLeave) {
        this.isAnnualLeave = isAnnualLeave;
    }

    public Integer getAtRedPoint() {
        return atRedPoint;
    }

    public void setAtRedPoint(Integer atRedPoint) {
        this.atRedPoint = atRedPoint;
    }


    public Leave getLeave() {
        return leave;
    }

    public void setLeave(Leave leave) {
        this.leave = leave;
    }

    public Outdoor getOutdoor() {
        return outdoor;
    }

    public void setOutdoor(Outdoor outdoor) {
        this.outdoor = outdoor;
    }

    public List<AppendSign> getAppendSigns() {
        return appendSigns;
    }

    public void setAppendSigns(List<AppendSign> appendSigns) {
        this.appendSigns = appendSigns;
    }

    public List<Overtime> getOvertimes() {
        return overtimes;
    }

    public void setOvertimes(List<Overtime> overtimes) {
        this.overtimes = overtimes;
    }

    public List<Expense> getExpenses() {
        return expenses;
    }

    public void setExpenses(List<Expense> expenses) {
        this.expenses = expenses;
    }

    public List<Flow> getFlows() {
        return flows;
    }

    public void setFlows(List<Flow> flows) {
        this.flows = flows;
    }

    public List<Participant> getParticipants() {
        return participants;
    }

    public void setParticipants(List<Participant> participants) {
        this.participants = participants;
    }

    public List<Money> getMoneys() {
        return moneys;
    }

    public void setMoneys(List<Money> moneys) {
        this.moneys = moneys;
    }

    public String getSearchContent() {
        return searchContent;
    }

    public void setSearchContent(String searchContent) {
        this.searchContent = searchContent;
    }

    public String getSearchMessage() {
        return searchMessage;
    }

    public void setSearchMessage(String searchMessage) {
        this.searchMessage = searchMessage;
    }

    public Integer getCompanyInfoId() {
        return companyInfoId;
    }

    public void setCompanyInfoId(Integer companyInfoId) {
        this.companyInfoId = companyInfoId;
    }

    public List<Integer> getOperations() {
        return operations;
    }

    public void setOperations(List<Integer> operations) {
        this.operations = operations;
    }

    public Integer getWithoutContact() {
        return withoutContact;
    }

    public void setWithoutContact(Integer withoutContact) {
        this.withoutContact = withoutContact;
    }

    public Integer getProxyContactId() {
        return proxyContactId;
    }

    public void setProxyContactId(Integer proxyContactId) {
        this.proxyContactId = proxyContactId;
    }


    public int getFinancialStatus() {
        return financialStatus;
    }

    public void setFinancialStatus(int financialStatus) {
        this.financialStatus = financialStatus;
    }

    public String getFinancialStatusSequence() {
        return financialStatusSequence;
    }

    public void setFinancialStatusSequence(String financialStatusSequence) {
        this.financialStatusSequence = financialStatusSequence;
    }

    @Override
    public String toString() {
        return "Request [componentsContent=" + componentsContent + ", requestDkey=" + requestDkey + ", requestName="
                + requestName + "]";
    }


    public void setLatestApprovedTime(String latestApprovedTime) {
        this.latestApprovedTime = latestApprovedTime;
    }

    public String getLatestApprovedTime() {
        return latestApprovedTime;
    }

    public String getShowTime() {
        return showTime;
    }

    public void setShowTime(String showTime) {
        this.showTime = showTime;
    }

    public Summary getSummary() {
        return summary;
    }

    public void setSummary(Summary summary) {
        this.summary = summary;
    }

    public Integer getOperate() {
        return operate;
    }

    public void setOperate(Integer operate) {
        this.operate = operate;
    }

    public VersionInfo getVersionInfo() {
        return versionInfo;
    }

    public void setVersionInfo(VersionInfo versionInfo) {
        this.versionInfo = versionInfo;
    }

    public List<Integer> getRequestIds() {
        return requestIds;
    }

    public void setRequestIds(List<Integer> requestIds) {
        this.requestIds = requestIds;
    }

    public Request getNewestRequest() {
        return newestRequest;
    }

    public void setNewestRequest(Request newestRequest) {
        this.newestRequest = newestRequest;
    }
}
